﻿using FreeSql.DataAnnotations;
using System.Reflection;

namespace WenAntdUI.Helps
{
    public static class TreeListHelp
    {
        /// <summary>
        /// 数据转换为树结构  还没有开发完成
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="items"></param>
        /// <returns></returns>
        public static List<T> ToTreeList<T>(this List<T> items)
        {
            var type = typeof(T);

            var keyField = type.GetProperties()
                .Select(t => t.GetCustomAttribute<NavigateAttribute>())
                .Where(t => t != null)
                .FirstOrDefault()?.Bind;

            return items;
        }
    }
}
